#/bin/bash
{
harddisk_log=/home/myzabbix/zabbix.lld.harddisk.log
harddisk_tmp="$(iostat -xdk 1 2 |awk '{print $1,$4,$5,$6,$7,$10,$11,$12}')"
lines=$((`echo "${harddisk_tmp}" |wc -l`/2))
echo "${harddisk_tmp}" |tail -n${lines} | egrep -v 'Device|^[ \t]{0,}$' > ${harddisk_log}

originData="$(awk '{ print "{\"{#BLOCKDEVICE}\":\""$1"\"}" }' ${harddisk_log})"
} 2>/dev/null

# 生成Json格式
echo "{\"data\":[`echo ${originData}|sed 's/ /,/g'`]}"